% GAUTIER LE BIHAN - 2020
% Replication files for "Shocks vs Menu Costs: Patterns of Price Rigidity in an Estimated Multi-Sector 
% Menu-Cost Model" Review of Economics and Statistics
% File:loop_over_param.m 
% Generates simulated data for Figure 1 in paper (stat_outsample_19.mat)


clear;
tic
addpath('..\..\Utilities')  


NSectors = 2;
sm = 0.0;


p0=[0.02:0.0025:0.08]';
mu_c=[0.01:0.0015:0.045]';
sig_eps=[0.03:0.001:0.055]';
rho_a=[0.6946]';

s=size(p0,1)+size(mu_c,1)+size(sig_eps,1);

  param0=[0.0502 ;0.0307; 0.0353 ;0.694600000000000];
s

param=repmat(param0,1,s)';
param(1:size(p0),1)=p0;
param(size(p0)+1:size(p0)+size(mu_c),2)=mu_c;
param(size(p0)+size(mu_c)+1:size(p0)+size(mu_c)+size(sig_eps),3)=sig_eps;


for jj=1:s;
    p0=param(jj,1);
    mu_c=param(jj,2);
    sig_eps_a=param(jj,3);
    rho_a=param(jj,4);   
    weight_j=0.57;    
    
    
   [f2, avfracup2,    med2,    interq2, kur2]=geNCalvoPlus_SMM(p0, mu_c, sig_eps_a, rho_a, weight_j);
 
  stat_outsample_19(jj,:)=[param(jj,:) f2 avfracup2      med2    interq2 kur2  ]

  save stat_outsample_19 stat_outsample_19;
end
